package seata.service.impl;

import com.wxg.storage.dao.mysql.mapper.StorageMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import seata.service.StorageService;


@Service
public class StorageServiceImpl implements StorageService {

    @Autowired
    private StorageMapper storageMapper;

    /**
     * 扣减库存
     */
    @Override
    public void decrease(Long productId, Integer count) {
        System.out.println("StorageServiceImpl.decrease 开始");
        storageMapper.decrease(productId,count);
        System.out.println("StorageServiceImpl.decrease 结束");
    }
}
